package org.monster.context.core.processor;

import org.monster.context.core.parameter.HttpResponse;
import org.monster.context.core.request.HttpRequest;

/**
 * 处理服务
 * @author Monster
 */
public class ProcessService implements Process {

    /**
     * 关闭
     */
    private static final String SHUTDOWN_PROCESS = "SHUTDOWN";

    /**
     * 处理
     *
     * @param request  请求
     * @param response 响应
     */
    @Override
    public boolean process(HttpRequest request, HttpResponse response) {
        String requestURI = request.getRequestURI();
        if (requestURI != null) {
            if (requestURI.equals("/" + SHUTDOWN_PROCESS)) {
                System.exit(0);
            }
        }
        return true;
    }
}
